-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PR #961/898ade59 backport][stable-4] Unit test cleanup #962
[PR #961/898ade59 backport][stable-4] Unit test cleanup #962
Conversation
Unit test cleanup SUMMARY Speaking to @mattclay, pytest based unit tests are generally considered preferred over unittest based unit tests. For the sake of having "good" examples in amazon.aws, migrates unittest based tests over to pytest Additionally: Moves tests about to reflect module_utils Cleans up the boto3/botocore test skipping uses "pytest.raises" rather than try/except blocks Cleans up unused variables Cleans up unused imports fixes s3_object unit test (was trying to import from the old location, redirects don't handle this) ISSUE TYPE Feature Pull Request COMPONENT NAME tests/units ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis <None> (cherry picked from commit 898ade5)
@patchback[bot] This PR contains |
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 4m 19s |
Build succeeded (gate pipeline). ✔️ ansible-galaxy-importer SUCCESS in 4m 19s |
…collections#962) wafv2_web_acl: prevent exception when element is not a dict SUMMARY the geo_match_statement statement paremeter country_codes is a list and will fail the current implementation File "/tmp/ansible_community.aws.wafv2_web_acl_payload_8xvwtxvw/ansible_community.aws.wafv2_web_acl_payload.zip/ansible_collections/community/aws/plugins/module_utils/wafv2.py", line 52, in wafv2_snake_dict_to_camel_dict AttributeError: 'str' object has no attribute 'keys' rules: - name: block-germany priority: 0 action: block: {} visibility_config: sampled_requests_enabled: yes cloud_watch_metrics_enabled: yes metric_name: block-germany statement: geo_match_statement: country_codes: - DE ISSUE TYPE Bugfix Pull Request COMPONENT NAME plugins/module_utils/wafv2.py ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis <None>
This is a backport of PR #961 as merged into main (898ade5).
SUMMARY
Speaking to mattclay,
pytest
based unit tests are generally considered preferred overunittest
based unit tests. For the sake of having "good" examples in amazon.aws, migrates unittest based tests over to pytestAdditionally:
ISSUE TYPE
COMPONENT NAME
tests/units
ADDITIONAL INFORMATION